Skip to content

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Aug 6, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jogru0 and others added 23 commits April 24, 2025 21:14
Add target features for sm_* and ptx*, both of which form a partial
order, but cannot be combined to a single partial order. These mirror
the LLVM target features, but we do not provide LLVM target
processors (which imply both an sm_* and ptx* feature).

Add some documentation for the nvptx target.
Normally LLVM and rustc agree about what features are implied by
target-cpu, but for NVPTX, LLVM considers sm_* and ptx* features to be
exclusive, which makes sense for codegen purposes. But in Rust, we want
to think of them as:

  sm_{sver} means that the target supports the hardware features of sver

  ptx{pver} means the driver supports PTX ISA pver

Intrinsics usually require a minimum sm_{sver} and ptx{pver}.

Prior to this commit, -Ctarget-cpu=sm_70 would activate only sm_70 and
ptx60 (the minimum PTX version that supports sm_70, which maximizes
driver compatibility). With this commit, it also activates all the
implied target features (sm_20, ..., sm_62; ptx32, ..., ptx50).
This avoids scheduling drops and immediately unscheduling them. Drops
for guard bindings/temporaries are still scheduled and unscheduled as
before.
Co-authored-by: Tshepang Mbambo <[email protected]>
…or indexing into a function table as described by RFC 3407
Make suggestions to remove params and super traits tool-only, and make
the suggestion span more accurate.

```
error[E0567]: auto traits cannot have generic parameters
  --> $DIR/auto-trait-validation.rs:6:19
   |
LL | auto trait Generic<T> {}
   |            -------^^^
   |            |
   |            auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
  --> $DIR/auto-trait-validation.rs:8:20
   |
LL | auto trait Bound : Copy {}
   |            -----   ^^^^
   |            |
   |            auto traits cannot have super traits or lifetime bounds
```

```
error[E0380]: auto traits cannot have associated items
  --> $DIR/issue-23080.rs:5:8
   |
LL | unsafe auto trait Trait {
   |                   ----- auto traits cannot have associated items
LL |     fn method(&self) {
   |        ^^^^^^
```
…r-errors

Tweak auto trait errors

Make suggestions to remove params and super traits verbose and make spans more accurate.

```
error[E0567]: auto traits cannot have generic parameters
  --> $DIR/auto-trait-validation.rs:6:19
   |
LL | auto trait Generic<T> {}
   |            -------^^^
   |            |
   |            auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
  --> $DIR/auto-trait-validation.rs:8:20
   |
LL | auto trait Bound : Copy {}
   |            -----   ^^^^
   |            |
   |            auto traits cannot have super traits or lifetime bounds
```

```
error[E0380]: auto traits cannot have associated items
  --> $DIR/issue-23080.rs:5:8
   |
LL | unsafe auto trait Trait {
   |                   ----- auto traits cannot have associated items
LL |     fn method(&self) {
   |        ^^^^^^
```
… r=ZuseZ4

add nvptx_target_feature

Tracking issue: rust-lang#141468 (nvptx), which is part of rust-lang#44839 (catch-all arches)
The feature gate is `#![feature(nvptx_target_feature)]`

This exposes the target features `sm_20` through `sm_120a` [as defined](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.1/llvm/lib/Target/NVPTX/NVPTX.td#L59-L85) by LLVM.

Cc: `@gonzalobg`
`@rustbot` label +O-NVPTX +A-target-feature
implement continue_ok and break_ok for ControlFlow

Tracking issue: rust-lang#140266

r? `@dtolnay`
… r=Nadrieril,traviscross

lower pattern bindings in the order they're written and base drop order on primary bindings' order

To fix rust-lang#142163, this PR does two things:
- Makes match arms base their drop order on the first sub-branch instead of the last sub-branch. Together with the second change, this makes bindings' drop order correspond to the relative order of when each binding first appears (i.e. the order of the "primary" bindings).
- Lowers pattern bindings in the order they're written (still treating the right-hand side of a ``@`` as coming before the binding on the left). In each sub-branch of a match arm, this is the order that would be obtained if the or-alternatives chosen in that sub-branch were inlined into the arm's pattern. This both affects drop order (making bindings in or-patterns not be dropped first) and fixes the issue in [this test](https://github.com/rust-lang/rust/blob/2a023bf80a6fbd6a06d5460a34eb247b986286ed/tests/ui/pattern/bindings-after-at/bind-by-copy-or-pat.rs) from rust-lang#121716.

My approach to the second point is admittedly a bit trickier than may be necessary. To avoid passing around a counter when building `FlatPat`s, I've instead added just enough information to recover the original structure of the pattern's bindings from a `MatchTreeSubBranch`'s path through the `Candidate` tree. Some alternatives:
- We could use a counter, then sort bindings by their ordinals when making `MatchTreeSubBranch`es.
- I'd like to experiment with always merging sub-candidates and removing `test_remaining_match_pairs_after_or`; that would require lowering bindings and guards in a different way. That makes it a bigger change too, though, so I figure it might be simplest to start here.
- For a very big change, we could track which or-alternatives succeed at runtime to base drop order on the binding order in the particular alternatives matched.

This is a breaking change. It will need a crater run, language team sign-off, and likely updates to the Reference.

This will conflict with rust-lang#143376 and probably also rust-lang#143028, so they shouldn't be merged at the same time.

r? `@matthewjasper` or `@Nadrieril`
…zelmann

Port #[macro_export] to the new attribute parsing infrastructure

Ports macro_export to the new attribute parsing infrastructure for rust-lang#131229 (comment)

r? `@oli-obk`

cc `@JonathanBrouwer` `@jdonszelmann`
…ffleLapkin

Additional tce tests

r? ``@oli-obk``

Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC.

Depends on rust-lang#144232

Closes rust-lang#144293
…oxyUwU

Add documentation for unstable_feature_bound

There is more detail and explanation in https://hackmd.io/``@tiif/Byd3mq7Ige``

Original PR that implemented this: rust-lang#140399

r? ``@BoxyUwU`` to nominate for types team discussion
…szelmann

Port `#[coroutine]` to the new attribute system

Related to rust-lang#131229 (comment).

r? ``@jdonszelmann``
…er, r=WaffleLapkin

Anonymize binders in tail call sig

See the comment for explanation

Fixes rust-lang#144826

r? WaffleLapkin
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 6, 2025
@rustbot rustbot added T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Aug 6, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Aug 6, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Aug 6, 2025

📌 Commit b616dfc has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2025
@bors
Copy link
Collaborator

bors commented Aug 6, 2025

⌛ Testing commit b616dfc with merge 3b9bdd2...

bors added a commit that referenced this pull request Aug 6, 2025
Rollup of 9 pull requests

Successful merges:

 - #137831 (Tweak auto trait errors)
 - #138689 (add nvptx_target_feature)
 - #140267 (implement continue_ok and break_ok for ControlFlow)
 - #143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order)
 - #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
 - #144650 (Additional tce tests)
 - #144676 (Add documentation for unstable_feature_bound)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144835 (Anonymize binders in tail call sig)

r? `@ghost`
`@rustbot` modify labels: rollup
@tgross35
Copy link
Contributor Author

tgross35 commented Aug 6, 2025

@bors r- retry

yield to the LLVM upgrade, it's in cache

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 6, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Aug 6, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 6, 2025

📌 Commit b616dfc has been approved by tgross35

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 6, 2025

⌛ Testing commit b616dfc with merge ec95ac0...

bors added a commit that referenced this pull request Aug 6, 2025
Rollup of 9 pull requests

Successful merges:

 - #137831 (Tweak auto trait errors)
 - #138689 (add nvptx_target_feature)
 - #140267 (implement continue_ok and break_ok for ControlFlow)
 - #143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order)
 - #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
 - #144650 (Additional tce tests)
 - #144676 (Add documentation for unstable_feature_bound)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144835 (Anonymize binders in tail call sig)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/explicit-tail-calls/in-closure.rs ... ok
test [ui] tests/ui/explicit-tail-calls/ctfe-id-unlimited.rs#become ... ok
test [ui] tests/ui/explicit-tail-calls/intrinsics.rs ... ok
test [ui] tests/ui/explicit-tail-calls/indexer.rs ... ok
test [ui] tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs ... FAILED
test [ui] tests/ui/explicit-tail-calls/drop-order.rs ... ok
test [ui] tests/ui/explicit-tail-calls/recursion-etc.rs ... ok
test [ui] tests/ui/explicit-tail-calls/return-lifetime-sub.rs ... ok
test [ui] tests/ui/explicit-tail-calls/return-mismatches.rs ... ok
test [ui] tests/ui/explicit-tail-calls/signature-mismatch.rs ... ok
---
test [ui] tests/ui/zero-sized/zero-sized-btreemap-insert.rs ... ok

failures:

---- [ui] tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/explicit-tail-calls/recursion-etc-u64wrapper/recursion-etc-u64wrapper.stderr`
diff of stderr:

- error: internal compiler error: $COMPILER_DIR_REAL/rustc_codegen_ssa/src/mir/block.rs:LL:CC: arguments using PassMode::Indirect are currently not supported for tail calls
+ error: internal compiler error: :LL:CC: arguments using PassMode::Indirect are currently not supported for tail calls
2   --> $DIR/recursion-etc-u64wrapper.rs:24:16
3    |
4 LL |           become count(

Note: some mismatched output was normalized before being compared
##[error]- error: internal compiler error: /rustc-dev/ec95ac00b447d1833f008a50925eae7a88faf19e/compiler/rustc_codegen_ssa/src/mir/block.rs:1059:17: arguments using PassMode::Indirect are currently not supported for tail calls
-   --> /checkout/tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs:24:16
+ error: internal compiler error: :LL:CC: arguments using PassMode::Indirect are currently not supported for tail calls


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args explicit-tail-calls/recursion-etc-u64wrapper.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=i586-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/explicit-tail-calls/recursion-etc-u64wrapper" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=i586-unknown-linux-gnu-gcc"
stdout: none
--- stderr -------------------------------
##[error]error: internal compiler error: /rustc-dev/ec95ac00b447d1833f008a50925eae7a88faf19e/compiler/rustc_codegen_ssa/src/mir/block.rs:1059:17: arguments using PassMode::Indirect are currently not supported for tail calls
  --> /checkout/tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs:24:16
   |
LL |           become count(
   |  ________________^
LL | |             U64Wrapper {
LL | |                 x: curr.x + 1,
LL | |                 arbitrary: curr.arbitrary,
LL | |             },
LL | |             top,
LL | |         )
   | |_________^

---
note: please make sure that you have updated to the latest nightly

note: rustc 1.91.0-nightly (ec95ac00b 2025-08-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -C linker=i586-unknown-linux-gnu-gcc

query stack during panic:
end of query stack
error: aborting due to 1 previous error
------------------------------------------



failures:
    [ui] tests/ui/explicit-tail-calls/recursion-etc-u64wrapper.rs

test result: FAILED. 19166 passed; 1 failed; 374 ignored; 0 measured; 0 filtered out; finished in 665.20s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=i586-unknown-linux-gnu
Build completed unsuccessfully in 0:47:17

@bors
Copy link
Collaborator

bors commented Aug 6, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 6, 2025
@tgross35 tgross35 mentioned this pull request Aug 6, 2025
@tgross35 tgross35 closed this Aug 6, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 6, 2025
@tgross35 tgross35 deleted the rollup-erh9qat branch August 6, 2025 09:50
@tnuha
Copy link
Contributor

tnuha commented Aug 6, 2025

Sorry to have another failure here, I thought GitHub CI passing would be sufficient. Are there any jobs beyond dist-i586-gnu-i586-i686-musl that could be hidden? i.e. beyond the checks on GitHub CI when I push to my own branch, and that job that I can perform locally, what else should I be trying to have pass before trying to have my changes pulled?

@tgross35
Copy link
Contributor Author

tgross35 commented Aug 6, 2025

No worries, it happens :) tough to say exactly, I'm assuming PR CI and merge CI just have the location at different locations - so more would probably fail, that job just happened to be first. Left a comment on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend rollup A PR which is a rollup T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.